﻿using Nemerle;
using Nemerle.Collections;
using Nemerle.Text;
using Nemerle.Utility;

using System;
using System.Collections.Generic;
using System.Linq;

using Nitra.Declarations;
using DotNet;

namespace Ammy.Symbols
{
  public class DefaultNamespaceSymbol : NamespaceSymbol
  {
    public static Create(reference : Reference, ownerScope : TableScope, context : DependentPropertyEvalContext) : this
    {
      def name = Name(reference.Location, reference.Text);
      def sym = ExternalDeclaration.[DefaultNamespaceSymbol](name).DefineSymbol(ownerScope);
      
      sym.SpanClass = DotNetLang.NamespaceSpanClass;
      sym.Kind = "default namespace";      
      sym.MemberTable = TableScope(sym, "MemberTable");
      sym.DeclaredIn = ownerScope.Owner :> NamespaceSymbol;
      
      sym.EvalProperties(context);
      
      sym;
    }
  }
}
